package com.cn.admin.thread;

import com.alibaba.fastjson.JSON;
import com.cn.admin.utils.HttpUtils;
import com.cn.admin.utils.ToolsUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;

public class MusicThread extends Thread{

    private static Logger logger = LoggerFactory.getLogger(MusicThread.class);
    private static  int a=0;


    //2):在A类中覆盖Thread类中的run方法.
    public void run() {
        //3):在run方法中编写需要执行的操作
        for(int i = 0; i < 1; i ++){

            a++;

            String tel = ToolsUtils.getTel();

            HashMap<String, String> map = new HashMap<>();
            map.put("Content-Type","application/x-www-form-urlencoded");

            HashMap<String, String> map1 = new HashMap<>();
            map1.put("mobile",tel);
            map1.put("name","口袋有钱");

            String jsonStr = JSON.toJSONString( map1 );


            logger.info("jsonStr===============>"+jsonStr);

            System.getProperties().setProperty("http.proxyHost", "10.22.40.32");
            System.getProperties().setProperty("http.proxyPort", "8991");
            //String s = HttpUtils.doPost("https://kdyouqian.com/koudai/userIosController/user_notecoller", map, jsonStr);
            String s = HttpUtils.doPost("http://192.168.20.61:8991/test/test4/", map, jsonStr);


            logger.info("s ===============>"+s );

            logger.info("a ===============>"+a );

        }
    }
}
